.class public Lorg/zeam/Folder;
.super Landroid/widget/LinearLayout;
.source "Folder.java"

# interfaces
.implements Lorg/zeam/DragSource;
.implements Landroid/widget/AdapterView$OnItemLongClickListener;
.implements Landroid/widget/AdapterView$OnItemClickListener;
.implements Landroid/view/View$OnClickListener;
.implements Landroid/view/View$OnLongClickListener;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/LinearLayout;",
        "Lorg/zeam/DragSource;",
        "Landroid/widget/AdapterView$OnItemLongClickListener;",
        "Landroid/widget/AdapterView$OnItemClickListener;",
        "Landroid/view/View$OnClickListener;",
        "Landroid/view/View$OnLongClickListener;"
    }
.end annotation


# instance fields
.field protected mCloseButton:Landroid/widget/Button;

.field protected mContent:Landroid/widget/AbsListView;

.field protected mDragItem:Lorg/zeam/ApplicationItemInfo;

.field protected mDragger:Lorg/zeam/DragController;

.field protected mInfo:Lorg/zeam/FolderInfo;

.field protected mLauncher:Lorg/zeam/Launcher;


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 32
    invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 33
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lorg/zeam/Folder;->setAlwaysDrawnWithCacheEnabled(Z)V

    .line 34
    return-void
.end method


# virtual methods
.method bind(Lorg/zeam/FolderInfo;)V
    .locals 2
    .parameter "info"

    .prologue
    .line 129
    iput-object p1, p0, Lorg/zeam/Folder;->mInfo:Lorg/zeam/FolderInfo;

    .line 130
    iget-object v0, p0, Lorg/zeam/Folder;->mCloseButton:Landroid/widget/Button;

    iget-object v1, p1, Lorg/zeam/FolderInfo;->title:Ljava/lang/CharSequence;

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 131
    return-void
.end method

.method getInfo()Lorg/zeam/FolderInfo;
    .locals 1

    .prologue
    .line 116
    iget-object v0, p0, Lorg/zeam/Folder;->mInfo:Lorg/zeam/FolderInfo;

    return-object v0
.end method

.method notifyDataSetChanged()V
    .locals 1

    .prologue
    .line 108
    iget-object v0, p0, Lorg/zeam/Folder;->mContent:Landroid/widget/AbsListView;

    invoke-virtual {v0}, Landroid/widget/AbsListView;->getAdapter()Landroid/widget/Adapter;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/widget/BaseAdapter;

    invoke-virtual {p0}, Landroid/widget/BaseAdapter;->notifyDataSetChanged()V

    .line 109
    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 1
    .parameter "v"

    .prologue
    .line 74
    iget-object v0, p0, Lorg/zeam/Folder;->mLauncher:Lorg/zeam/Launcher;

    invoke-virtual {v0, p0}, Lorg/zeam/Launcher;->closeFolder(Lorg/zeam/Folder;)V

    .line 75
    return-void
.end method

.method onClose()V
    .locals 2

    .prologue
    .line 124
    iget-object v1, p0, Lorg/zeam/Folder;->mLauncher:Lorg/zeam/Launcher;

    invoke-virtual {v1}, Lorg/zeam/Launcher;->getWorkspace()Lorg/zeam/Workspace;

    move-result-object v0

    .line 125
    .local v0, workspace:Lorg/zeam/Workspace;
    invoke-virtual {v0}, Lorg/zeam/Workspace;->getCurrentScreen()I

    move-result v1

    invoke-virtual {v0, v1}, Lorg/zeam/Workspace;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    invoke-virtual {v1}, Landroid/view/View;->requestFocus()Z

    .line 126
    return-void
.end method

.method public onDropCompleted(Landroid/view/View;Z)V
    .locals 0
    .parameter "target"
    .parameter "success"

    .prologue
    .line 101
    return-void
.end method

.method protected onFinishInflate()V
    .locals 3

    .prologue
    .line 38
    invoke-super {p0}, Landroid/widget/LinearLayout;->onFinishInflate()V

    .line 40
    const v2, 0x7f06001f

    invoke-virtual {p0, v2}, Lorg/zeam/Folder;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/AbsListView;

    iput-object v2, p0, Lorg/zeam/Folder;->mContent:Landroid/widget/AbsListView;

    .line 41
    iget-object v2, p0, Lorg/zeam/Folder;->mContent:Landroid/widget/AbsListView;

    invoke-virtual {v2, p0}, Landroid/widget/AbsListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 42
    iget-object v2, p0, Lorg/zeam/Folder;->mContent:Landroid/widget/AbsListView;

    invoke-virtual {v2, p0}, Landroid/widget/AbsListView;->setOnItemLongClickListener(Landroid/widget/AdapterView$OnItemLongClickListener;)V

    .line 43
    const v2, 0x7f06001e

    invoke-virtual {p0, v2}, Lorg/zeam/Folder;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/Button;

    iput-object v2, p0, Lorg/zeam/Folder;->mCloseButton:Landroid/widget/Button;

    .line 44
    iget-object v2, p0, Lorg/zeam/Folder;->mCloseButton:Landroid/widget/Button;

    invoke-virtual {v2, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 45
    iget-object v2, p0, Lorg/zeam/Folder;->mCloseButton:Landroid/widget/Button;

    invoke-virtual {v2, p0}, Landroid/widget/Button;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    .line 47
    invoke-virtual {p0}, Lorg/zeam/Folder;->getContext()Landroid/content/Context;

    move-result-object v0

    .line 49
    .local v0, context:Landroid/content/Context;
    iget-object v2, p0, Lorg/zeam/Folder;->mContent:Landroid/widget/AbsListView;

    instance-of v2, v2, Landroid/widget/GridView;

    .line 48
    invoke-static {v0, v2}, Lorg/zeam/SelectorDrawable;->createSelector(Landroid/content/Context;Z)Lorg/zeam/SelectorDrawable;

    move-result-object v1

    .line 51
    .local v1, selectorDrawable:Landroid/graphics/drawable/Drawable;
    iget-object v2, p0, Lorg/zeam/Folder;->mContent:Landroid/widget/AbsListView;

    invoke-virtual {v2, v1}, Landroid/widget/AbsListView;->setSelector(Landroid/graphics/drawable/Drawable;)V

    .line 52
    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 4
    .parameter "parent"
    .parameter "view"
    .parameter "position"
    .parameter "id"

    .prologue
    .line 57
    invoke-virtual {p1, p3}, Landroid/widget/AdapterView;->getItemAtPosition(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/zeam/ApplicationItemInfo;

    .line 59
    .local v0, applicationItemInfo:Lorg/zeam/ApplicationItemInfo;
    if-eqz p2, :cond_0

    .line 60
    new-instance v1, Landroid/graphics/Rect;

    invoke-direct {v1}, Landroid/graphics/Rect;-><init>()V

    .line 61
    .local v1, sourceBounds:Landroid/graphics/Rect;
    invoke-virtual {p2, v1}, Landroid/view/View;->getGlobalVisibleRect(Landroid/graphics/Rect;)Z

    .line 63
    :try_start_0
    iget-object v2, v0, Lorg/zeam/ApplicationItemInfo;->intent:Landroid/content/Intent;

    invoke-virtual {v2, v1}, Landroid/content/Intent;->setSourceBounds(Landroid/graphics/Rect;)V
    :try_end_0
    .catch Ljava/lang/NoSuchMethodError; {:try_start_0 .. :try_end_0} :catch_0

    .line 67
    .end local v1           #sourceBounds:Landroid/graphics/Rect;
    :cond_0
    :goto_0
    iget-object v2, p0, Lorg/zeam/Folder;->mLauncher:Lorg/zeam/Launcher;

    iget-object v3, v0, Lorg/zeam/ApplicationItemInfo;->intent:Landroid/content/Intent;

    invoke-virtual {v2, v3}, Lorg/zeam/Launcher;->startActivitySafely(Landroid/content/Intent;)V

    .line 71
    return-void

    .line 64
    .restart local v1       #sourceBounds:Landroid/graphics/Rect;
    :catch_0
    move-exception v2

    goto :goto_0
.end method

.method public onItemLongClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)Z
    .locals 3
    .parameter
    .parameter "view"
    .parameter "position"
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)Z"
        }
    .end annotation

    .prologue
    .local p1, parent:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    const/4 v2, 0x1

    .line 86
    invoke-virtual {p2}, Landroid/view/View;->isInTouchMode()Z

    move-result v1

    if-nez v1, :cond_0

    .line 87
    const/4 v1, 0x0

    .line 93
    :goto_0
    return v1

    .line 89
    :cond_0
    invoke-virtual {p1, p3}, Landroid/widget/AdapterView;->getItemAtPosition(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/zeam/ApplicationItemInfo;

    .line 90
    .local v0, applicationItemInfo:Lorg/zeam/ApplicationItemInfo;
    iget-object v1, p0, Lorg/zeam/Folder;->mDragger:Lorg/zeam/DragController;

    invoke-interface {v1, p2, p0, v0, v2}, Lorg/zeam/DragController;->startDrag(Landroid/view/View;Lorg/zeam/DragSource;Ljava/lang/Object;I)V

    .line 91
    iput-object v0, p0, Lorg/zeam/Folder;->mDragItem:Lorg/zeam/ApplicationItemInfo;

    .line 92
    iget-object v1, p0, Lorg/zeam/Folder;->mLauncher:Lorg/zeam/Launcher;

    invoke-virtual {v1, p0}, Lorg/zeam/Launcher;->closeFolder(Lorg/zeam/Folder;)V

    move v1, v2

    .line 93
    goto :goto_0
.end method

.method public onLongClick(Landroid/view/View;)Z
    .locals 2
    .parameter "view"

    .prologue
    .line 79
    iget-object v0, p0, Lorg/zeam/Folder;->mLauncher:Lorg/zeam/Launcher;

    invoke-virtual {v0, p0}, Lorg/zeam/Launcher;->closeFolder(Lorg/zeam/Folder;)V

    .line 80
    iget-object v0, p0, Lorg/zeam/Folder;->mLauncher:Lorg/zeam/Launcher;

    iget-object v1, p0, Lorg/zeam/Folder;->mInfo:Lorg/zeam/FolderInfo;

    invoke-virtual {v0, v1}, Lorg/zeam/Launcher;->showRenameDialog(Lorg/zeam/FolderInfo;)V

    .line 81
    const/4 v0, 0x1

    return v0
.end method

.method onOpen()V
    .locals 1

    .prologue
    .line 120
    iget-object v0, p0, Lorg/zeam/Folder;->mContent:Landroid/widget/AbsListView;

    invoke-virtual {v0}, Landroid/widget/AbsListView;->requestLayout()V

    .line 121
    return-void
.end method

.method setContentAdapter(Landroid/widget/BaseAdapter;)V
    .locals 1
    .parameter "adapter"

    .prologue
    .line 104
    iget-object v0, p0, Lorg/zeam/Folder;->mContent:Landroid/widget/AbsListView;

    invoke-virtual {v0, p1}, Landroid/widget/AbsListView;->setAdapter(Landroid/widget/Adapter;)V

    .line 105
    return-void
.end method

.method public setDragger(Lorg/zeam/DragController;)V
    .locals 0
    .parameter "dragger"

    .prologue
    .line 97
    iput-object p1, p0, Lorg/zeam/Folder;->mDragger:Lorg/zeam/DragController;

    .line 98
    return-void
.end method

.method setLauncher(Lorg/zeam/Launcher;)V
    .locals 0
    .parameter "launcher"

    .prologue
    .line 112
    iput-object p1, p0, Lorg/zeam/Folder;->mLauncher:Lorg/zeam/Launcher;

    .line 113
    return-void
.end method
